<html xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro" lang="en" th:with="unixstamp=${#dates.createNow().time}">
<head th:replace="common::header">
</head>
<link rel="stylesheet" th:href="@{/plugin/ztree/css/zTreeStyle/zTreeStyle.css}">
<style>
    .ztree * {
        font-size: 20px;
    }
    .ztree li{
        padding : 10px;
    }
    .layui-form-switch{
        width:170px;
    }
</style>
<body>
	<div class="layui-fluid">
		<div class="layui-row">
			<div class="layui-col-md12">
                <div class="layui-fluid">
                    <div class="layui-fluid">
                        <div class="layui-card">
                            <div class="layui-card-header mlk-title layui-bg-cyan">废品类别管理</div>
                            <div class="layui-card-body">
                                <button type="button" class="layui-btn layui-btn-normal" id="addMainType">添加主分类</button>
                                <ul id="tree" class="ztree"></ul>
                            </div>
                        </div>
                    </div>
                </div>
			</div>
		</div>
	</div>

<div id="viewTreeNodePrice" class="mlk-hide">
    <button type="button" class="layui-btn layui-btn-normal" id="addTypePriceButton">添加价格</button>
    <hr>
    <div id="priceContent">
        <!--这里会添加很多的价格信息-->
    </div>
</div>

<div id="addTreeNodePrice" class="mlk-hide">
    <form class="layui-form layui-form-pane" id="addTreeNodePriceForm">
        <div class="layui-form-item" pane>
            <label class="layui-form-label">浮动最低价格</label>
            <div class="layui-input-block">
                <input type="text" name="minPrice" required  lay-verify="required" placeholder="请输入浮动最低价格" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item" pane>
            <label class="layui-form-label">浮动最高价格</label>
            <div class="layui-input-block">
                <input type="text" name="maxPrice" required  lay-verify="required" placeholder="请输入浮动最高价格" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item" pane>
            <label class="layui-form-label">备注信息</label>
            <div class="layui-input-block">
                <input type="text" name="remark" required  lay-verify="required" placeholder="请输入备注信息" autocomplete="off" class="layui-input">
            </div>
        </div>
        <input type="reset" class="mlk-hide" id="addTreeNodePriceForm_reset">
    </form>
</div>

<div id="editTreeNodePrice" class="mlk-hide">
    <form class="layui-form layui-form-pane" id="editTreeNodePriceForm" lay-filter="editTreeNodePriceForm">
        <input type="hidden" name="id">
        <div class="layui-form-item" pane>
            <label class="layui-form-label">浮动最低价格</label>
            <div class="layui-input-block">
                <input type="text" name="minPrice" required  lay-verify="required" placeholder="请输入浮动最低价格" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item" pane>
            <label class="layui-form-label">浮动最高价格</label>
            <div class="layui-input-block">
                <input type="text" name="maxPrice" required  lay-verify="required" placeholder="请输入浮动最高价格" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item" pane>
            <label class="layui-form-label">备注信息</label>
            <div class="layui-input-block">
                <input type="text" name="remark" required  lay-verify="required" placeholder="请输入备注信息" autocomplete="off" class="layui-input">
            </div>
        </div>
    </form>
</div>

<!--启用和关闭按钮-->
<div class="mlk-hide" id="openOrCloseLayer">
    <form class="layui-form" action="">
        <div class="layui-form-item">
            <input type="checkbox" id="switch-input" lay-filter="switch-input"  name="tree_switch" width="120px" lay-skin="switch" lay-text="开启|关闭" value="1">
        </div>
    </form>
</div>

<!-- 添加主分类-->
<div id="mainAddLayer" class="mlk-hide">
    <form class="layui-form layui-form-pane" id="mainAddForm" lay-filter="mainAddForm">
        <div class="layui-form-item" pane>
            <label class="layui-form-label">废品名称</label>
            <div class="layui-input-block">
                <input type="text" name="name" required  lay-verify="required" placeholder="请输入废品名称" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item" pane>
            <label class="layui-form-label">估量下单时计量单位</label>
            <div class="layui-input-block">
                <input type="text" name="unit" required  lay-verify="required" placeholder="请输入估量下单时计量单位" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item" pane>
            <label class="layui-form-label">明细下单时计量单位</label>
            <div class="layui-input-block">
                <input type="text" name="detailUnit" required  lay-verify="required" placeholder="请输入明细下单时计量单位" autocomplete="off" class="layui-input">
            </div>
        </div>
    </form>
</div>

<div id="editUnitLayer" class="mlk-hide">
    <form class="layui-form layui-form-pane" id="editUnitForm" lay-filter="editUnitForm">
        <input type="hidden" name="id">
        <div class="layui-form-item" pane>
            <label class="layui-form-label">估量下单时计量单位</label>
            <div class="layui-input-block">
                <input type="text" name="unit" required  lay-verify="required" placeholder="请输入估量下单时计量单位" autocomplete="off" class="layui-input">
            </div>
        </div>
        <div class="layui-form-item" pane>
            <label class="layui-form-label">明细下单时计量单位</label>
            <div class="layui-input-block">
                <input type="text" name="detailUnit" required  lay-verify="required" placeholder="请输入明细下单时计量单位" autocomplete="off" class="layui-input">
            </div>
        </div>
    </form>
</div>
<script type="text/html" id="toolbar">
    <a class="layui-btn layui-btn-sm layui-btn-warm" lay-event="addPrice">新增浮动价格</a>
</script>

    <script type="text/html" id="tool">
        <a class="layui-btn layui-btn-sm layui-btn-warm" lay-event="delPrice">删除</a>
        <a class="layui-btn layui-btn-sm" lay-event="editPrice">修改</a>
    </script>
</body>
	<div th:include="common::footer"></div>
    <script type="text/javascript" th:src="@{/plugin/ztree/js/jquery.ztree.core.js}"></script>
    <script type="text/javascript" th:src="@{/plugin/ztree/js/jquery.ztree.exedit.js}"></script>
    <script type="text/javascript" th:src="@{/js/waste/wasteTree.js}"></script>
</html>